namespace java thrift.generated

# thrift --gen java src/main/resources/thrift/target.thrift
# 容器类型: list, set, map
# 枚举: enum

typedef i16 short
typedef i32 int
typedef i64 long
typedef bool boolean
typedef string String

# Class
struct Person {
    1: optional String username,
    2: optional int age,
    3: optional boolean married
}

# 通信接口可能抛出的异常
exception DataException {
    1: optional String message,
    2: optional String callStack,
    3: optional String date
}

# 通信接口
service PersonService {
    Person getPersonByUsername(1: required String username) throws (1: DataException dataException),

    void savePerson(1: required Person person) throws (1: DataException dataException)
}